$(function(){
			//点击显示导航栏
			$(".menu").hide();
			$(".navbtn").click(function(){
				$(".menu").toggle();
				$(".product-menu").hide();
			});
			//点击显示二级菜单
			$(".product-menu").hide();
			$("#swiper-banner").click(function(){
				$(".product-menu").toggle();
			});
			$(".product-menu").click(function(){
				$(".product-menu").hide();
			});
			// 选项卡切换
			$(".qie").find(".case-child:not(:eq(0))").hide();
			$(".fourth-line").find(".cp:not(:eq(0))").hide();
				$(".case>div").click(function(){
					var a = $(this).index();
					//alert(a);
					$(".qie").find(".case-child").eq(a).show().siblings().hide();
					$(this).addClass("active").siblings().removeClass("active");
				});
				$(".cl").click(function(){
					var a = $(this).index();
					//alert(a);
					$(".fourth-line").find(".cp").eq(a).show().siblings().hide();
					$(this).addClass("active").siblings().removeClass("active");
				});
		})
		
		//banner
		var mySwiper = new Swiper('#swiper-banner', {
			autoplay: {
				delay: 5000, //1秒切换一次
			},
			effect: 'fade',
			loop: true, // 循环模式选项
			// 如果需要前进后退按钮
			navigation: {
				nextEl: '.swiper-button-next',
				prevEl: '.swiper-button-prev',
			}
		})
		
		effect = 0
		var swiper = new Swiper('#case-img', {
			loop: true,
			autoplay: {
				delay: 3000, //1秒切换一次
			},
			speed: 2500,
			slidesPerView: 3,
			spaceBetween: 10,
			centeredSlides: true,
			watchSlidesProgress: true,
			on: {
				setTranslate: function() {
					slides = this.slides
					for (i = 0; i < slides.length; i++) {
						slide = slides.eq(i)
						progress = slides[i].progress
						//slide.html(progress.toFixed(2)); 看清楚progress是怎么变化的
						slide.css({
							'opacity': '',
							'background': ''
						});
						slide.transform(''); //清除样式
		
						if (effect == 1) {
							slide.transform('scale(' + (1 - Math.abs(progress) / 8) + ')');
						} else if (effect == 2) {
							slide.css('opacity', (1 - Math.abs(progress) / 6));
							slide.transform('translate3d(0,' + Math.abs(progress) * 20 + 'px, 0)');
						} else if (effect == 3) {
							slide.transform('rotate(' + progress * 30 + 'deg)');
						} else if (effect == 4) {
							slide.css('background', 'rgba(' + (255 - Math.abs(progress) * 20) + ',' + (127 + progress * 32) + ',' + Math.abs(
								progress) * 64 + ')');
						}
		
					}
				},
				setTransition: function(transition) {
					for (var i = 0; i < this.slides.length; i++) {
						var slide = this.slides.eq(i)
						slide.transition(transition);
					}
				},
			},
			navigation: {
				nextEl: '.swiper-button-next',
				prevEl: '.swiper-button-prev',
			},
			pagination: {
				el: '.swiper-pagination',
				clickable: true,
			},
		});
		
		pe = document.getElementById('progressEffect');
		pe.onchange = function() {
			effect = this.value
			swiper.update();
		}